package org.abc.fund.controller.strategy.response;

import java.math.BigDecimal;
import java.time.LocalDate;
import lombok.Builder;
import lombok.Data;
import org.abc.fund.entity.strategy.RebalanceRule;

@Data
@Builder
public class RebalanceRuleResponse {
  private RebalanceRule.Type type;
  private RebalanceRule.Frequency frequency;
  private BigDecimal threshold;

  public static RebalanceRuleResponse fromEntity(RebalanceRule rule) {
    if (rule == null) return null;
    return RebalanceRuleResponse.builder()
        .type(rule.getType())
        .frequency(rule.getFrequency())
        .threshold(rule.getThreshold())
        .build();
  }
}
